from threading import Thread
import time


def task(name):
    print('%s is running' % name)
    time.sleep(1)
    print('%s is running' % name)


if __name__ == '__main__':
    t = Thread(target=task, args=('egon', ))
    t.daemon = True
    t.start()
    print('主')

"""
主线程运行结束之后不会立即结束 会等待所有其他非守护线程结束才会结束
    因为主线程的结束意味着所在的进程的结束
"""
